package com.duowei.diandan.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import java.util.Random;

public class RandomImageLinearLayout extends LinearLayout {

    private boolean mFlag = false;
    private Paint mPaint = new Paint();
    private Random mRandom = new Random();

    public RandomImageLinearLayout(Context context) {
        super(context);
    }

    public RandomImageLinearLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

//        if (mFlag) {
//            mFlag = false;
//
//            int size = getWidth() / 100;
//            for (int i = 0; i < size; i++) {
//                Bitmap bitmap = ResourceUtil.getBitmap(getContext(), ImageRes.getBgItemImage());
//                canvas.drawBitmap(bitmap, mRandom.nextInt(getWidth()), mRandom.nextInt(getHeight()), mPaint);
//            }
//        }
    }
}
